import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class HomeNav extends StatelessWidget {
 HomeNav({ super.key });

final List<Map<String, dynamic>> navList = [
  {
    "text":"我的房屋",
    "icon":"assets/images/house_nav_icon@2x.png"
  },
   {
    "text":"在线报修",
    "icon":"assets/images/repair_nav_icon@2x.png"
  },
  {
    "text":"访客邀请",
    "icon":"assets/images/visitor_nav_icon@2x.png"
  },
];

  @override
  Widget build(BuildContext context){
    return Container( 
      // margin:EdgeInsets.fromLTRB(10,0,10,0),
      padding: EdgeInsets.fromLTRB(10,20,10,20,),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10)
      ),
      alignment: Alignment.center,
      
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children:  navList.map((item){
          return Column(
            children: [
              Image.asset(item["icon"],width: 24,height: 24,),
              SizedBox(height: 5,),
              Text(item["text"],style: TextStyle(fontSize: 12,color: Color(0xff434242)),)
            ]
          );
        }).toList(),
      ),
    );
  }
}